<?php

namespace app\index\service;

use app\index\model\AccountModel;
use app\index\model\ArchiveModel;
use app\index\model\BidModel;
use app\index\model\CertBorrowModel;
use app\index\model\CertUseModel;
use app\index\model\DeptModel;
use app\index\model\EnginBondShouModel;
use app\index\model\EnginModel;
use app\index\model\UserGangModel;
use app\index\model\UserModel;
use app\index\validate\CertUse;

class FactorService
{

    public function bid($factor, $minfo){
        $minfo['engin_name'] = $minfo['name'];
        $minfo['business'] = $minfo['business'] == 1 ? '自营' : '联营';
        $minfo['engin_chanid'] = DeptModel::get_name_by_pk($minfo['chanid']);
        return $this->check_valid($factor, $minfo);
    }


    public function cert_borrow($factor, $minfo){
        return $this->check_valid($factor, $minfo);
    }
    public function cert_down($factor, $minfo){
        return $this->check_valid($factor, $minfo);
    }



    public function cert_use_bid($factor, $minfo){
        $engin = BidModel::get_info_by_pk($minfo['enginid']);

        $minfo['engin_name'] = $engin['name'];
        $minfo['business'] = $engin['business'] == 1 ? '自营' : '联营';
        $minfo['engin_chanid'] = DeptModel::get_name_by_pk($engin['chanid']);
        return $this->check_valid($factor, $minfo);
    }


    public function cert_use($factor, $minfo){
        $engin = EnginModel::get_info_by_pk($minfo['enginid']);
        $minfo['engin_name'] = $engin['name'];
        $minfo['business'] = $engin['business'] == 1 ? '自营' : '联营';
        $minfo['engin_chanid'] = DeptModel::get_name_by_pk($engin['chanid']);
        return $this->check_valid($factor, $minfo);
    }

    public function bid_book($factor, $minfo){
        $engin = BidModel::get_info_by_pk($minfo['enginid']);
        $minfo['engin_name'] = $engin['name'];
        $minfo['business'] = $engin['business'] == 1 ? '自营' : '联营';
        $minfo['engin_chanid'] = DeptModel::get_name_by_pk($engin['chanid']);
        $minfo['maker_name'] = UserModel::get_realname_by_pk($minfo['maker']);
        return $this->check_valid($factor, $minfo);
    }


    public function engin($factor, $minfo){
        $minfo['engin_name'] = $minfo['name'];
        $minfo['business'] = $minfo['business'] == 1 ? '自营' : '联营';
        $minfo['engin_chanid'] = DeptModel::get_name_by_pk($minfo['chanid']);
        return $this->check_valid($factor, $minfo);
    }


    public function engin_junyan($factor, $minfo){
        $engin = EnginModel::get_info_by_pk($minfo['enginid']);
        $minfo['engin_name'] = $engin['name'];
        $minfo['business'] = $engin['business'] == 1 ? '自营' : '联营';
        $minfo['engin_chanid'] = DeptModel::get_name_by_pk($engin['chanid']);
        return $this->check_valid($factor, $minfo);
    }
    public function engin_junjie($factor, $minfo){
        $engin = EnginModel::get_info_by_pk($minfo['enginid']);
        $minfo['engin_name'] = $engin['name'];
        $minfo['business'] = $engin['business'] == 1 ? '自营' : '联营';
        $minfo['engin_chanid'] = DeptModel::get_name_by_pk($engin['chanid']);
        return $this->check_valid($factor, $minfo);
    }


    public function contract_shi($factor, $minfo){
        $engin = EnginModel::get_info_by_pk($minfo['enginid']);
        $minfo['engin_name'] = $engin['name'];
        $minfo['business'] = $engin['business'] == 1 ? '自营' : '联营';
        $minfo['engin_chanid'] = DeptModel::get_name_by_pk($engin['chanid']);
        $minfo['shihetype'] = (new OptService())->get_base_showname('engin_shihetype', $minfo['shihetype']);
        $minfo['state'] = (new ContractService())->get_contract_shi_state_name($minfo['id'], $minfo['state']);
        return $this->check_valid($factor, $minfo);
    }

    public function contract_bu($factor, $minfo){
        $engin = EnginModel::get_info_by_pk($minfo['enginid']);
        $minfo['engin_name'] = $engin['name'];
        $minfo['business'] = $engin['business'] == 1 ? '自营' : '联营';
        $minfo['engin_chanid'] = DeptModel::get_name_by_pk($engin['chanid']);
        return $this->check_valid($factor, $minfo);
    }

    public function contract_cai($factor, $minfo){
        $engin = EnginModel::get_info_by_pk($minfo['enginid']);
        $minfo['engin_name'] = $engin['name'];
        $minfo['business'] = $engin['business'] == 1 ? '自营' : '联营';
        $minfo['engin_chanid'] = DeptModel::get_name_by_pk($engin['chanid']);
        $minfo['state'] = (new ContractService())->get_contract_cai_state_name($minfo['id'], $minfo['state']);
        $minfo['caihetype'] = (new ContractService())->get_contract_caihetype_name($minfo['caihetype']);
        $minfo['caiheshu'] = (new OptService())->get_base_showname('engin_caiheshu', $minfo['caiheshu']);
        return $this->check_valid($factor, $minfo);
    }

    public function contract_bian($factor, $minfo){
        $engin = EnginModel::get_info_by_pk($minfo['enginid']);
        $minfo['engin_name'] = $engin['name'];
        $minfo['business'] = $engin['business'] == 1 ? '自营' : '联营';
        $minfo['engin_chanid'] = DeptModel::get_name_by_pk($engin['chanid']);
        return $this->check_valid($factor, $minfo);
    }

    public function engin_budget($factor, $minfo){
        $engin = EnginModel::get_info_by_pk($minfo['enginid']);
        $minfo['engin_name'] = $engin['name'];
        $minfo['business'] = $engin['business'] == 1 ? '自营' : '联营';
        $minfo['engin_chanid'] = DeptModel::get_name_by_pk($engin['chanid']);
        return $this->check_valid($factor, $minfo);
    }

    public function engin_budbian($factor, $minfo){
        $engin = EnginModel::get_info_by_pk($minfo['enginid']);
        $minfo['engin_name'] = $engin['name'];
        $minfo['business'] = $engin['business'] == 1 ? '自营' : '联营';
        $minfo['engin_chanid'] = DeptModel::get_name_by_pk($engin['chanid']);
        if($minfo['type'] == 1){
            $minfo['type'] = '调整';
        }elseif($minfo['type'] == 2){
            $minfo['type'] = '增项';
        }elseif($minfo['type'] == 3){
            $minfo['type'] = '调整及增项';
        }
        return $this->check_valid($factor, $minfo);
    }

    public function payment_engin($factor, $minfo){
        $engin = EnginModel::get_info_by_pk($minfo['enginid']);
        $minfo['engin_name'] = $engin['name'];
        $minfo['business'] = $engin['business'] == 1 ? '自营' : '联营';
        $minfo['engin_chanid'] = DeptModel::get_name_by_pk($engin['chanid']);
        $minfo['budid'] = (new PaymentService())->get_payment_budid_name($minfo['budid']);
        return $this->check_valid($factor, $minfo);
    }

    public function contract_nei($factor, $minfo){
        $engin = EnginModel::get_info_by_pk($minfo['enginid']);
        $minfo['engin_name'] = $engin['name'];
        $minfo['business'] = $engin['business'] == 1 ? '自营' : '联营';
        $minfo['engin_chanid'] = DeptModel::get_name_by_pk($engin['chanid']);
        $minfo['neihetype'] = (new ContractService())->get_contract_neihetype_name($minfo['neihetype']);
        $minfo['state'] = (new ContractService())->get_contract_nei_state_name($minfo['id'], $minfo['state']);
        return $this->check_valid($factor, $minfo);
    }

    public function payment_neifu($factor, $minfo){
        $engin = EnginModel::get_info_by_pk($minfo['enginid']);
        $minfo['engin_name'] = $engin['name'];
        $minfo['business'] = $engin['business'] == 1 ? '自营' : '联营';
        $minfo['engin_chanid'] = DeptModel::get_name_by_pk($engin['chanid']);
        return $this->check_valid($factor, $minfo);
    }


    public function stuff_cai($factor, $minfo){
        $engin = EnginModel::get_info_by_pk($minfo['enginid']);
        $minfo['engin_name'] = $engin['name'];
        $minfo['business'] = $engin['business'] == 1 ? '自营' : '联营';
        $minfo['engin_chanid'] = DeptModel::get_name_by_pk($engin['chanid']);
        return $this->check_valid($factor, $minfo);
    }
    public function stuff_ru($factor, $minfo){
        $engin = EnginModel::get_info_by_pk($minfo['enginid']);
        $minfo['engin_name'] = $engin['name'];
        $minfo['business'] = $engin['business'] == 1 ? '自营' : '联营';
        $minfo['engin_chanid'] = DeptModel::get_name_by_pk($engin['chanid']);
        return $this->check_valid($factor, $minfo);
    }

    public function stuff_jie($factor, $minfo){
        $engin = EnginModel::get_info_by_pk($minfo['enginid']);
        $minfo['engin_name'] = $engin['name'];
        $minfo['business'] = $engin['business'] == 1 ? '自营' : '联营';
        $minfo['engin_chanid'] = DeptModel::get_name_by_pk($engin['chanid']);
        return $this->check_valid($factor, $minfo);
    }

    public function labour_shen($factor, $minfo){
        $engin = EnginModel::get_info_by_pk($minfo['enginid']);
        $minfo['engin_name'] = $engin['name'];
        $minfo['business'] = $engin['business'] == 1 ? '自营' : '联营';
        $minfo['engin_chanid'] = DeptModel::get_name_by_pk($engin['chanid']);
        return $this->check_valid($factor, $minfo);
    }

    public function labour_ling($factor, $minfo){
        $engin = EnginModel::get_info_by_pk($minfo['enginid']);
        $minfo['engin_name'] = $engin['name'];
        $minfo['business'] = $engin['business'] == 1 ? '自营' : '联营';
        $minfo['engin_chanid'] = DeptModel::get_name_by_pk($engin['chanid']);
        return $this->check_valid($factor, $minfo);
    }

    public function labour_yong($factor, $minfo){
        $engin = EnginModel::get_info_by_pk($minfo['enginid']);
        $minfo['engin_name'] = $engin['name'];
        $minfo['business'] = $engin['business'] == 1 ? '自营' : '联营';
        $minfo['engin_chanid'] = DeptModel::get_name_by_pk($engin['chanid']);
        return $this->check_valid($factor, $minfo);
    }

    public function labour_jie($factor, $minfo){
        $engin = EnginModel::get_info_by_pk($minfo['enginid']);
        $minfo['engin_name'] = $engin['name'];
        $minfo['business'] = $engin['business'] == 1 ? '自营' : '联营';
        $minfo['engin_chanid'] = DeptModel::get_name_by_pk($engin['chanid']);
        return $this->check_valid($factor, $minfo);
    }

    public function device_jin($factor, $minfo){
        $engin = EnginModel::get_info_by_pk($minfo['enginid']);
        $minfo['engin_name'] = $engin['name'];
        $minfo['business'] = $engin['business'] == 1 ? '自营' : '联营';
        $minfo['engin_chanid'] = DeptModel::get_name_by_pk($engin['chanid']);
        return $this->check_valid($factor, $minfo);
    }

    public function device_jie($factor, $minfo){
        $engin = EnginModel::get_info_by_pk($minfo['enginid']);
        $minfo['engin_name'] = $engin['name'];
        $minfo['business'] = $engin['business'] == 1 ? '自营' : '联营';
        $minfo['engin_chanid'] = DeptModel::get_name_by_pk($engin['chanid']);
        return $this->check_valid($factor, $minfo);
    }

    public function device_lin($factor, $minfo){
        $engin = EnginModel::get_info_by_pk($minfo['enginid']);
        $minfo['engin_name'] = $engin['name'];
        $minfo['business'] = $engin['business'] == 1 ? '自营' : '联营';
        $minfo['engin_chanid'] = DeptModel::get_name_by_pk($engin['chanid']);
        return $this->check_valid($factor, $minfo);
    }

    public function subbao_shen($factor, $minfo){
        $engin = EnginModel::get_info_by_pk($minfo['enginid']);
        $minfo['engin_name'] = $engin['name'];
        $minfo['business'] = $engin['business'] == 1 ? '自营' : '联营';
        $minfo['engin_chanid'] = DeptModel::get_name_by_pk($engin['chanid']);
        return $this->check_valid($factor, $minfo);
    }

    public function subbao_jie($factor, $minfo){
        $engin = EnginModel::get_info_by_pk($minfo['enginid']);
        $minfo['engin_name'] = $engin['name'];
        $minfo['business'] = $engin['business'] == 1 ? '自营' : '联营';
        $minfo['engin_chanid'] = DeptModel::get_name_by_pk($engin['chanid']);
        return $this->check_valid($factor, $minfo);
    }


    public function piao_tax($factor, $minfo){
        $engin = EnginModel::get_info_by_pk($minfo['enginid']);
        $minfo['engin_name'] = $engin['name'];
        $minfo['business'] = $engin['business'] == 1 ? '自营' : '联营';
        $minfo['engin_chanid'] = DeptModel::get_name_by_pk($engin['chanid']);
        return $this->check_valid($factor, $minfo);
    }

    public function visa($factor, $minfo){
        $engin = EnginModel::get_info_by_pk($minfo['enginid']);
        $minfo['engin_name'] = $engin['name'];
        $minfo['business'] = $engin['business'] == 1 ? '自营' : '联营';
        $minfo['engin_chanid'] = DeptModel::get_name_by_pk($engin['chanid']);
        $minfo['visatype'] = (new OptService())->get_base_showname('scene_visatype', $minfo['visatype']);
        return $this->check_valid($factor, $minfo);
    }

    public function engin_diary($factor, $minfo){
        $engin = EnginModel::get_info_by_pk($minfo['enginid']);
        $minfo['engin_name'] = $engin['name'];
        $minfo['business'] = $engin['business'] == 1 ? '自营' : '联营';
        $minfo['engin_chanid'] = DeptModel::get_name_by_pk($engin['chanid']);
        return $this->check_valid($factor, $minfo);
    }

    public function engin_speed($factor, $minfo){
        $engin = EnginModel::get_info_by_pk($minfo['enginid']);
        $minfo['engin_name'] = $engin['name'];
        $minfo['business'] = $engin['business'] == 1 ? '自营' : '联营';
        $minfo['engin_chanid'] = DeptModel::get_name_by_pk($engin['chanid']);
        return $this->check_valid($factor, $minfo);
    }

    public function engin_chan($factor, $minfo){
        $engin = EnginModel::get_info_by_pk($minfo['enginid']);
        $minfo['engin_name'] = $engin['name'];
        $minfo['business'] = $engin['business'] == 1 ? '自营' : '联营';
        $minfo['engin_chanid'] = DeptModel::get_name_by_pk($engin['chanid']);
        return $this->check_valid($factor, $minfo);
    }

    public function engin_stamp($factor, $minfo){
        $engin = EnginModel::get_info_by_pk($minfo['enginid']);
        $minfo['engin_name'] = $engin['name'];
        $minfo['business'] = $engin['business'] == 1 ? '自营' : '联营';
        $minfo['engin_chanid'] = DeptModel::get_name_by_pk($engin['chanid']);
        $minfo['zitype'] = (new OptService())->get_base_showname('scene_zitype', $minfo['zitype']);
        return $this->check_valid($factor, $minfo);
    }

    public function payment_day($factor, $minfo){
        return $this->check_valid($factor, $minfo);
    }

    public function payment_bao($factor, $minfo){
        $engin = EnginModel::get_info_by_pk($minfo['enginid']);
        $minfo['engin_name'] = $engin['name'];
        $minfo['business'] = $engin['business'] == 1 ? '自营' : '联营';
        $minfo['engin_chanid'] = DeptModel::get_name_by_pk($engin['chanid']);
        return $this->check_valid($factor, $minfo);
    }

    public function payment_gong($factor, $minfo){
        return $this->check_valid($factor, $minfo);
    }

    public function payment_jie($factor, $minfo){
        $minfo['incyong'] = (new OptService())->get_base_showname('cai_income_incyong', $minfo['incyong']);
        return $this->check_valid($factor, $minfo);
    }

    public function income_huan($factor, $minfo){
        return $this->check_valid($factor, $minfo);
    }

    public function piao_kai($factor, $minfo){
        $engin = EnginModel::get_info_by_pk($minfo['enginid']);
        $minfo['engin_name'] = $engin['name'];
        $minfo['business'] = $engin['business'] == 1 ? '自营' : '联营';
        $minfo['engin_chanid'] = DeptModel::get_name_by_pk($engin['chanid']);
        $minfo['piaotype'] = (new PiaoService())->get_kai_piaotype_name($minfo['piaotype']);
        return $this->check_valid($factor, $minfo);
    }

    public function account_diao($factor, $minfo){
        $minfo['chuid'] = AccountModel::where(['id'=>$minfo['chuid']])->value('name');
        $minfo['ruid'] = AccountModel::where(['id'=>$minfo['ruid']])->value('name');
        return $this->check_valid($factor, $minfo);
    }

    public function dealcom($factor, $minfo){
        $minfo['type'] = (new OptService())->get_base_showname('cai_dealcom_type', $minfo['type']);
        return $this->check_valid($factor, $minfo);
    }
    public function dealcom_geng($factor, $minfo){
        $minfo['type'] = (new OptService())->get_base_showname('cai_dealcom_type', $minfo['type']);
        return $this->check_valid($factor, $minfo);
    }

    public function wen_ban($factor, $minfo){
        $minfo['wentype'] = (new OptService())->get_base_showname('qi_wen_wentype', $minfo['wentype']);
        $minfo['wenzi'] = (new OptService())->get_base_showname('qi_wen_wenzi', $minfo['wenzi']);
        $minfo['wenlevel'] = (new OptService())->get_base_showname('qi_wen_wenlevel', $minfo['wenlevel']);
        $minfo['wenjin'] = (new OptService())->get_base_showname('qi_wen_wenjin', $minfo['wenjin']);
        $minfo['zhudept'] = DeptModel::get_name_by_ids($minfo['zhudept']);
        return $this->check_valid($factor, $minfo);
    }

    public function wu_cai($factor, $minfo){
        return $this->check_valid($factor, $minfo);
    }

    public function wu_ling($factor, $minfo){
        return $this->check_valid($factor, $minfo);
    }

    public function seal_gai($factor, $minfo){
        return $this->check_valid($factor, $minfo);
    }

    public function dang_jie($factor, $minfo){
        return $this->check_valid($factor, $minfo);
    }



    public function wage($factor, $minfo){
        return $this->check_valid($factor, $minfo);
    }







    public function cert_zhao($factor, $minfo){
        $minfo['deptxu_name'] = DeptModel::where(['id'=>$minfo['deptxu']])->value('name');
        return $this->check_valid($factor, $minfo);
    }

    public function archive_jiao($factor, $minfo){
        return $this->check_valid($factor, $minfo);
    }

    public function engin_bond_jiao($factor, $minfo){
        if($minfo['bidid'] > 0){
            $engin = BidModel::get_info_by_pk($minfo['bidid']);
        }else{
            $engin = EnginModel::get_info_by_pk($minfo['enginid']);
        }
        $minfo['engin_name'] = $engin['name'];
        $minfo['business'] = $engin['business'] == 1 ? '自营' : '联营';
        $minfo['engin_chanid'] = DeptModel::get_name_by_pk($engin['chanid']);
        $minfo['bondtype'] = (new PaymentService())->get_engin_bondtype_name($minfo['bondtype']);
        return $this->check_valid($factor, $minfo);
    }

    public function engin_bond_fan($factor, $minfo){
        $shouinfo = EnginBondShouModel::where(['id'=>$minfo['shouid']])->find();
        if($shouinfo['bidid'] > 0){
            $engin = BidModel::get_info_by_pk($shouinfo['bidid']);
        }else{
            $engin = EnginModel::get_info_by_pk($shouinfo['enginid']);
        }
        $minfo['engin_name'] = $engin['name'];
        $minfo['business'] = $engin['business'] == 1 ? '自营' : '联营';
        $minfo['engin_chanid'] = DeptModel::get_name_by_pk($engin['chanid']);
        $minfo['bondtype'] = (new PaymentService())->get_engin_bondtype_name($shouinfo['bondtype']);
        return $this->check_valid($factor, $minfo);
    }

    public function engin_bond_kai($factor, $minfo){
        if($minfo['bidid'] > 0){
            $engin = BidModel::get_info_by_pk($minfo['bidid']);
        }else{
            $engin = EnginModel::get_info_by_pk($minfo['enginid']);
        }
        $minfo['engin_name'] = $engin['name'];
        $minfo['business'] = $engin['business'] == 1 ? '自营' : '联营';
        $minfo['engin_chanid'] = DeptModel::get_name_by_pk($engin['chanid']);
        $minfo['bondtype'] = (new PaymentService())->get_engin_bondtype_name($minfo['bondtype']);
        $minfo['hantype'] = (new OptService())->get_base_showname('engin_bond_hantype', $minfo['hantype']);
        return $this->check_valid($factor, $minfo);
    }

    public function tongyong($factor, $minfo){
        $minfo['shilei'] = (new OptService())->get_base_showname('qi_tongyong_shilei', $minfo['shilei']);
        return $this->check_valid($factor, $minfo);
    }


    public function archive_out($factor, $minfo){
        $gangid = UserModel::where(['id'=>$minfo['created_user_old']])->value('gangid');
        $minfo['gangname'] = UserGangModel::get_name_by_ids($gangid);
        $minfo['outtype'] = (new OptService())->get_base_showname('qi_archive_outtype', $minfo['outtype']);
        return $this->check_valid($factor, $minfo);
    }
    public function kao_jia($factor, $minfo){
        $gangid = UserModel::where(['id'=>$minfo['created_user_old']])->value('gangid');
        $minfo['gangname'] = UserGangModel::get_name_by_ids($gangid);
        $minfo['jiatype'] = (new OptService())->get_base_showname('qi_kao_jiatype', $minfo['jiatype']);
        return $this->check_valid($factor, $minfo);
    }
    public function kao_chu($factor, $minfo){
        $gangid = UserModel::where(['id'=>$minfo['created_user_old']])->value('gangid');
        $minfo['gangname'] = UserGangModel::get_name_by_ids($gangid);
        return $this->check_valid($factor, $minfo);
    }
    public function kao_ban($factor, $minfo){
        $gangid = UserModel::where(['id'=>$minfo['created_user_old']])->value('gangid');
        $minfo['gangname'] = UserGangModel::get_name_by_ids($gangid);
        return $this->check_valid($factor, $minfo);
    }
    public function kao_chai($factor, $minfo){
        $gangid = UserModel::where(['id'=>$minfo['created_user_old']])->value('gangid');
        $minfo['gangname'] = UserGangModel::get_name_by_ids($gangid);
        return $this->check_valid($factor, $minfo);
    }
    public function archive_diao($factor, $minfo){
        $gangid = UserModel::where(['id'=>$minfo['created_user_old']])->value('gangid');
        $minfo['gangname'] = UserGangModel::get_name_by_ids($gangid);
        $minfo['diaotype'] = (new OptService())->get_base_showname('qi_archive_diaotype', $minfo['diaotype']);
        $minfo['diaodept_name'] = DeptModel::get_name_by_pk($minfo['diaodept']);
        return $this->check_valid($factor, $minfo);
    }

    public function archive_zhuan($factor, $minfo){
        $gangid = UserModel::where(['id'=>$minfo['created_user_old']])->value('gangid');
        $minfo['gangname'] = UserGangModel::get_name_by_ids($gangid);
        return $this->check_valid($factor, $minfo);
    }
    public function cert_perru($factor, $minfo){
        $gangid = UserModel::where(['id'=>$minfo['created_user_old']])->value('gangid');
        $minfo['gangname'] = UserGangModel::get_name_by_ids($gangid);
        $minfo['nature'] = (new OptService())->get_base_showname('person_nature', $minfo['nature']);
        $minfo['deptid_name'] = DeptModel::where(['id'=>$minfo['deptid']])->value('name');
        return $this->check_valid($factor, $minfo);
    }









    private function check_valid($factor, $minfo){
        $result = false;
        foreach ($factor as $fac){
            $fres = true;
            foreach ($fac as $item){
                if(!$this->check_field_factor($minfo[$item['fieldname']], $item['fieldtype'], $item['fieldvalue'])){
                    $fres = false; continue;
                }
            }
            if($fres){
                $result = true; break;
            }
        }
        return $result;
    }
    private function check_field_factor($value, $conder, $convalue){
        if($conder == 'like'){
            if(strpos($value, $convalue) !== false){
                return true;
            }
        }elseif($conder == 'not like'){
            if(strpos($value, $convalue) === false){
                return true;
            }
        }elseif($conder == 'eq'){
            if($value == $convalue){
                return true;
            }
        }elseif($conder == 'neq'){
            if($value != $convalue){
                return true;
            }
        }elseif($conder == 'gt'){
            if($value > $convalue){
                return true;
            }
        }elseif($conder == 'egt'){
            if($value >= $convalue){
                return true;
            }
        }elseif($conder == 'lt'){
            if($value < $convalue){
                return true;
            }
        }elseif($conder == 'elt'){
            if($value <= $convalue){
                return true;
            }
        }

        return false;
    }

}
